package com.secf.service.port.hpy.hys.test;

import java.util.Arrays;

/**
 * @Author ms
 * @Date 2024-08-08 15:54
 */
public class ArrayTest {
    public static void main(String[] args) {
        int[] numbers = {5, 3, 8, 1, 2};

        Arrays.sort(numbers);
        System.out.println("Sorted array: " + Arrays.toString(numbers));

        int index = Arrays.binarySearch(numbers, 3);
        System.out.println("Index of 3: " + index);

        int[] newNumbers = Arrays.copyOf(numbers, 10);
        System.out.println("Copied array with new length: " + Arrays.toString(newNumbers));
    }
}